package com.liao.rabbitmq.controller;

import com.liao.rabbitmq.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RabbitMQController {

    @Autowired
    private MessageService messageService;

    @RequestMapping("/produce/{message}")
    public String produce(@PathVariable(value = "message") String message){
        messageService.produce(message);
        return "发送成功";
    }
}
